﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using TrainingManagement.api.Models.BusinessLogic;
using TrainingManagement.api.Models.BusinessLogic.Skill;
using TrainingManagement.api.Models.BusinessObjects;
using TrainingManagement.api.Models.BusinessObjects.Responses;
using  Provausio.Common.Utility.Extensions;

namespace TrainingManagement.api.Controllers
{
    public class SkillController : ApiController
    {
        public Skill PutNewSkill(Skill skill)
        {
            return new SkillCreateOperation().Run(skill);
        }

        [System.Web.Http.ActionName("Update")]
        public void PostUpdateSkill(Skill skill)
        {
            new SkillUpdateOperation().Run(skill);
        }

        public void DeleteSkill(string skillId)
        {
            var id = skillId.ToType<int>();
            new SkillDeleteOperation().Run(id);
        }

        public List<Skill> GetSkill(int? skillSetId)
        {
            return new SkillSelectOperation().Run(skillSetId);
        }

    }
}
